using System.ComponentModel.DataAnnotations;

namespace Gateway.IQuery.Sign.Request;

/// <summary>
/// 密码登录请求
/// </summary>
public class LoginPasswordRequest : IValidatableObject
{
    /// <summary>
    /// 账号
    /// </summary>
    public string Account { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    public string Password { get; set; }


    /// <summary>
    /// 验证码
    /// </summary>
    public string Code { get; set; }
    
    /// <summary>
    /// 校验 验证码 结果的id
    /// </summary>
    public string CheckCodeId { get; set; }

    public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
    {
        if (string.IsNullOrEmpty(Account) || string.IsNullOrEmpty(Password))
            yield return new ValidationResult("账号或密码不能为空");
    }
}